package com.cody.service.impl;

import com.cody.dao.AnswerDao;
import com.cody.entity.Answer;
import com.cody.service.AnswerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Cody
 * @date 2021/4/9 - 15:36
 */
@Service
public class AnswerServiceImpl implements AnswerService {
    @Autowired
    private AnswerDao answerDao;

    @Override
    public List<Answer> queryAllAnswer() {
        return answerDao.queryAllAnswer();
    }

    @Override
    public List<Answer> queryAllAnswerByAnswerRespondId(String answerRespondId) {
        return answerDao.queryAllAnswerByAnswerRespondId(answerRespondId);
    }

    @Override
    public List<Answer> queryAnswerByKeyword(String keyword) {
        return answerDao.queryAnswerByKeyword(keyword);
    }

    @Override
    public Answer queryAllAnswerByAnswerId(Integer answerId) {
        return answerDao.queryAllAnswerByAnswerId(answerId);
    }

    @Override
    public List<Answer> queryAllAnswerByQuestionId(Integer questionId) {
        return answerDao.queryAllAnswerByQuestionId(questionId);
    }

    @Override
    public boolean updAnswerInfo(Answer answer) {
        return answerDao.updAnswerInfo(answer);
    }

    @Override
    public boolean insertAnswer(Answer answer) {
        return answerDao.insertAnswer(answer);
    }

    @Override
    public boolean delAnswerByAnswerId(Integer answerId) {
        return answerDao.delAnswerByAnswerId(answerId);
    }
}
